import httpRequest from "@/utils/request.js";

export function GetMatterList(params) {
	return new Promise((resolve, reject) => {
		httpRequest({
			method: "GET",
			url: "/matter/list",
			params
		}).then(res => {
			resolve(res.data);
		}).catch(err => {
			reject(err);
		})
	})
}

export function GetMatterInfo(params) {
	return new Promise((resolve, reject) => {
		httpRequest({
			method: "GET",
			url: "/matter/info",
			params
		}).then(res => {
			resolve(res.data);
		}).catch(err => {
			reject(err);
		})
	})
}

export function GetMatterCategory() {
	return new Promise((resolve, reject) => {
		httpRequest({
			method: "GET",
			url: "/matter/category"
		}).then(res => {
			resolve(res.data);
		}).catch(err => {
			reject(err);
		})
	})
}

export function CreateOrder(data) {
	return new Promise((resolve, reject) => {
		httpRequest({
			method: "POST",
			url: "/order",
			data
		}).then(res => {
			resolve(res.data);
		}).catch(err => {
			reject(err);
		})
	})
}

export function GetOrderList(params){
	return new Promise((resolve, reject) => {
		httpRequest({
			url: "/order",
			params
		}).then(res => {
			resolve(res.data);
		}).catch(err => {
			reject(err);
		})
	})
}

export function SearchMatter(params) {
	return new Promise((resolve, reject) => {
		httpRequest({
			method: "GET",
			url: "/matter/search",
			params
		}).then(res => {
			resolve(res.data);
		}).catch(err => {
			reject(err);
		})
	})
}